<template>
  <div id="app">
    <!-- <Loading v-if="!complete"></Loading> -->
    <keep-alive>
      <router-view v-if="$route.meta.keepAlive">
        <!-- 这里是会被缓存的视图组件 -->
      </router-view>
    </keep-alive>
    <router-view v-if="!$route.meta.keepAlive">
      <!-- 这里是不被缓存的视图组件 -->
    </router-view>
  </div>
</template>

<script>
import Loading from "./components/Loading";
export default {
  name: "app",
  data() {
    return {
      complete: false //页面是否加载完成
    };
  },
  beforeCreate() {
    const w = document.documentElement.clientWidth;
    if (w <= 1024) {
      window.chartFontSize = 12;
    }
    if (1024 < w <= 1420) {
      window.chartFontSize = 12;
    }
    if (1420 < w <= 1919) {
      window.chartFontSize = 14;
    }
    if (w > 1919) {
      window.chartFontSize = 18;
    }
  },
  mounted() {
    const self = this;
    // 首屏加载动画
    const getDocumentStatus = setInterval(function() {
      let status = document.readyState;
      if (status === "complete") {
        self.complete = true;
        window.clearTimeout(getDocumentStatus);
      } else {
        self.complete = false;
      }
    }, 300);
  },
  components: {
    Loading
  }
};
</script>

<style lang="less">
@import "./utils/theme.less";

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-size: 16px;
}

@media only screen and (min-width: 1421px) and (max-width: 1919px) {
  html {
    font-size: 14px !important;
  }
}

@media only screen and (min-width: 1025px) and (max-width: 1420px) {
  html {
    font-size: 12px !important;
  }
}

@media only screen and (max-width: 1024px) {
  html {
    font-size: 10px !important;
  }
}

#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  // color: #2c3e50;
  color: #fff;
  width: 100%;
  height: 100%;
  position: relative;
}
.abstract {
  padding: 10px 20px;
  p {
    line-height: 20px;
    text-align: left;
  }
}

.echarts {
  width: 100% !important;
  height: 100% !important;
}

/*标注提示*/
.amap-marker-label {
  color: #fff;
  border: none;
  background-color: @font-black;
  white-space: nowrap;
  box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  overflow: hidden;
  padding: 0;
  .map-label {
    .map-label-name,
    .map-label-link {
      display: inline-block;
      padding: 0.3vw;
      font-size: 1rem;
    }
    .map-label-link {
      background: orange;
      cursor: pointer;
      min-width: 16px;
      text-align: center;
      i {
        font-size: 1rem;
        color: #fff;
      }
    }
  }
  // screenProject页面的label样式
  .screenProject-label {
    padding: 0.5vw;
    font-size: 1.2rem;
  }
  // label-info
  .label-info {
    // padding: 5px;
    // font-size: 14px;
    // line-height: 20px;
  }
}
// 地图弹出框样式
.map-window {
  padding: 0.5vw !important;
  z-index: 999;
  .header {
    // padding: 0.5vw;
    position: relative;
    .title {
      font-size: 1.4rem;
      color: @font-black;
      margin-bottom: 0.5vw;
      background: #fff;
    }
    .btn {
      position: absolute;
      top: 0;
      right: 0;
      padding: 0;
      background: transparent;
      border: none;
      outline: none;
      cursor: pointer;
      font-size: 1.4rem;
      height: 100%;
      width: 25px;
      i {
        font-size: 1.2rem;
      }
    }
  }
  // 主内容区
  .main {
    width: 100%;
    table {
      table-layout: fixed;
      border-collapse: separate;
      font-size: 1.2rem;
      border-top: 1px solid @font-regular;
      border-left: 1px solid @font-regular;
      color: @font-black;
      width: 100%;
      tbody {
        display: table-row-group;
        vertical-align: middle;
        border-color: inherit;
        width: 100%;
        tr {
          display: table-row;
          vertical-align: inherit;
          border-color: inherit;
          td {
            width: 33%;
            min-width: 0;
            box-sizing: border-box;
            text-overflow: ellipsis;
            vertical-align: middle;
            position: relative;
            text-align: left;
            display: table-cell;
            position: relative;
            padding: 0.3vw;
            border-right: 1px solid @font-regular;
            border-bottom: 1px solid @font-regular;
            img {
              width: 100%;
              height: auto;
              margin: auto;
            }
          }
          .label {
            text-align: center;
          }
          .value {
            text-align: left;
          }
        }
      }
    }
    .detailBtn {
      width: 100%;
      text-align: right;
      padding-top: 0.5vw;
      a {
        color: @primary;
        font-size: 1.2rem;
      }
    }
  }
  .submit-box {
    text-align: right;
    margin-top: 5px;
  }
  // 底部箭头
  .top-arrow {
    bottom: -20px;
    margin-right: 3px;
    border-top-color: #fff !important;
    border-bottom-width: 0 !important;
  }
  .popper__arrow {
    border-width: 10px !important;
    &:after {
      border-width: 10px !important;
    }
  }
}

// 征收房屋类型中bar的字体
.el-progress-bar__innerText {
  font-size: 1.2rem !important;
}
.el-progress-bar__outer {
  background: rgba(0, 0, 0, 0.7) !important;
}

.sign-content-modal {
  max-height: 70vh;
  background: rgba(0, 0, 0, 0.7) !important;
  overflow: hidden;
  .el-dialog__header {
    color: #fff;
    height: 10vh;
    .el-dialog__title {
      color: #fff;
    }
    .el-dialog__headerbtn {
      color: #fff;
      i {
        color: #fff;
      }
    }
  }
  .el-dialog__body {
    height: 60vh;
    overflow: auto;
    box-sizing: border-box;
    padding: 0;
  }
}

/*定位动画*/
@-webkit-keyframes ball-scale-multiple {
  0% {
    -webkit-transform: scale(0);
    transform: scale(0);
    opacity: 0;
  }

  5% {
    opacity: 1;
  }

  100% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 0;
  }
}

@keyframes ball-scale-multiple {
  0% {
    -webkit-transform: scale(0);
    transform: scale(0);
    opacity: 0;
  }

  5% {
    opacity: 1;
  }

  100% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 0;
  }
}

.ball-scale-multiple {
  position: relative;
  -webkit-transform: translateY(-30px);
  -ms-transform: translateY(-30px);
  transform: translateY(-30px);
}
.ball-scale-multiple > div:nth-child(2) {
  -webkit-animation-delay: 0.2s;
  animation-delay: 0.2s;
}
.ball-scale-multiple > div:nth-child(3) {
  -webkit-animation-delay: 0.4s;
  animation-delay: 0.4s;
}
.ball-scale-multiple > div {
  background-color: #00b7e5;
  width: 15px;
  height: 15px;
  border-radius: 100%;
  margin: 2px;
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
  position: absolute;
  left: 0px;
  top: 0px;
  opacity: 0;
  margin: 0;
  width: 60px;
  height: 60px;
  -webkit-animation: ball-scale-multiple 1s 0s linear infinite;
  animation: ball-scale-multiple 1s 0s linear infinite;
}
// 遮住高德地图的logo
.amap-logo,
.amap-copyright {
  display: none;
  opacity: 0;
}

// 覆盖header中el-select的样式
.header {
  .el-select,
  .el-cascader {
    .el-input__inner {
      border: none !important;
      background: rgba(0, 0, 0, 0) !important;
      color: #fff !important;
      width: 10vw !important;
      font-size: 1.4rem !important;
      font-weight: 600 !important;
      padding-left: 0px !important;
    }
    .el-icon-arrow-up {
      color: #fff !important;
      font-weight: 600 !important;
      font-size: 1.4rem !important;
    }
  }

  // 级联选择样式覆盖
  .el-cascader {
    .el-cascader__label {
      color: #fff !important;
      width: 10vw !important;
      font-size: 1.4rem !important;
      font-weight: 600 !important;
      padding-left: 0px !important;
    }
    .el-icon-arrow-down {
      color: #fff !important;
      font-weight: 600 !important;
      font-size: 1.4rem !important;
    }
  }
}

.el-select-dropdown__item,
.el-cascader-menu__item {
  font-size: 1.4rem !important;
  height: 3rem !important;
  line-height: 3rem !important;
}

.area {
  .el-input__suffix {
    // margin-top: -5px !important;
    height: 40px !important;
  }
}
.el-cascader__label {
  height: 40px !important;
  line-height: 40px !important;
}
</style>
